package com.ishopping.common.core.base.enums;

public enum ReturnEnum {

	SUCCESS("200", "success"),

	USER_FAIL("300","user operator fail"),

	SERVER_ERROR("500", "program error"),

	UNKNOWN("900", "unknown reason");

	private String value;
	private String text;

	private ReturnEnum(String value, String text){
		this.value = value;
		this.text = text;
	}
	
	public String getValue(){
		return this.value;
	}
	public String getText(){
		return this.text;
	}
	
	public static String getTextByValue(String value) {
		String text = "";
		for(ReturnEnum e : ReturnEnum.values()){
			if (e.getValue().equals(value)) {
				text = e.getText();
				break;
			}
        }
		return text;
	}
}
